import {
  GET_SYSTEMINFO_SUCCESS,
  SET_USERINFO,
  SET_SIGNLIST,
  SET_ORDERLIST,
  GET_ORDERLIST,
  SET_ORDERDETAILS,
  GET_NETWORK,
  SET_AUTHORIZE,
  SET_OPENID,
  SET_SESSIONKEY
} from './mutation-type';
export default {
    [GET_SYSTEMINFO_SUCCESS](state, systemInfo) {
        state.systemInfo = systemInfo; 
    },
    [SET_USERINFO](state,userInfo){
        state.userInfo = userInfo;
    },
    [SET_AUTHORIZE](state,authorize) {
      state.authorize = authorize;
    },
    [SET_OPENID](state, openid) {
      state.openid = openid;
    },
    [SET_SESSIONKEY](state, sessionKey) {
      state.sessionKey = sessionKey;
    },
    [SET_SIGNLIST](state, signList) {
      state.signList = signList;
    },
    [SET_ORDERLIST](state,data){
      if(data.type==0){
        state.unsentOrders = data.list
      } else if (data.type == 1) {
        state.unacceptedOrders = data.list
      } else if (data.type == 2) {
        state.acceptedOrders = data.list
      } else if (data.type == 3) {
        state.finishedOrders = data.list
      }
    },
    [SET_ORDERDETAILS](state,order){
        state.orderDetails[order.orderId] = order;
    }
}